﻿@model DingTalkAgent.Model.SysPage
@{
    ViewBag.Title = "Edit";
    Layout = null;
}

<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
    <h4 class="modal-title">修改页面</h4>
</div>

<div class="modal-body">
@using (Html.BeginForm("SysPEdit", "SysBase", FormMethod.Post, new { id = "form_Edit", name = "form_Edit" }))
            {
        <table cellspacing="0" cellpadding="0" width="100%" class="table">
            <tr>
                <th>
                    页面代码：
                </th>
                <td>
                    @Html.TextBoxFor(m => m.Code, new { @readonly = "readonly",  @class = "form-control" })
                    <div>
                    </div>
                </td>
            </tr>
            <tr>
                <th>
                    页名字：
                </th>
                <td>
                    @Html.TextBoxFor(model => model.Name, new { @class = "form-control" })
                    @Html.HiddenFor(model => model.Page_ID)
                    <div>
                    </div>
                </td>
            </tr>
            <tr>
                <th>
                    上层页面：
                </th>
                <td>
                    @Html.Hidden("Parent_ID", -1)
                    @Html.TextBox("ParentName", ViewData["ParentName"], new { @class = "form-control" })@Html.Hidden("ParentCode", "ParentCode")
                    <div>
                        @Html.HiddenFor(model => model.Page_ID)
                        <a href="#" onclick="selectPage()" class="btn btn-outline btn-success">选择</a><a href="#" onclick="ClearPage()" class="btn btn-outline btn-success">..清空..</a>   
                        如果不选择表示是主层页面,子页面不在权限分配中出现。
                    </div>
                </td>
            </tr>
            <tr>
                <th>
                    排序编号：
                </th>
                <td>
                    @Html.TextBoxFor(model => model.OrderID, new { @class = "form-control" })
                    <div>
                        降序排列，只可以为数字。
                    </div>
                </td>
            </tr>
            <tr>
                <th>
                    描述：
                </th>
                <td>
                    @Html.TextAreaFor(model => model.Remark, new { @class = "form-control" })
                    <div>
                    </div>
                </td>
            </tr>
            <tr>
                <th>
                    Controller：
                </th>
                <td>
                    @Html.TextBoxFor(model => model.Controller, new { @class = "form-control" })
                    <div>
                    </div>
                </td>
            </tr>
            <tr>
                <th>
                    Action：
                </th>
                <td>
                    @Html.TextBoxFor(model => model.Action, new { @class = "form-control" })
                    <div>
                    </div>
                </td>
            </tr>
            <tr>
                <th>
                    是否启用：
                </th>
                <td>
                    @Html.CheckBoxFor(model => model.active)是
                    <div>
                    </div>
                </td>
            </tr>
        </table>
    }
    <div class="remark">
        <div class="remark_tit">
            温馨提示
        </div>
        <div class="remark_content">
            <p>
                <span class="must">*</span>*项必须填写。
            </p>
        </div>
    </div>
</div>

<div class="modal-footer">
    <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
    <button type="button" class="btn btn-primary" id="Edit">保存</button>
</div>

<div class="modal fade" id="mydialogmodal" tabindex="-1" role="dialog" aria-labelledby="modal">
    <div class="modal-dialog" role="document">
        <div class="modal-content  animated bounceInRight">
        </div>
    </div>
</div>


    <script type="text/javascript">
        $(document).ready(function () {
            $("#Edit").click(function () {
                SetData("/SysBase/SysPEdit", "信息修改成功!");
            });

        });
        function selectPage() {
            layer.open({
                type: 2,
                title: false,
                skin: 'layui-layer-lan',
                shadeClose: false,
                shade: 0.3,
                scrollbar: false,
                area: ['1000px', '720px'],
                content: 'SysPList?isPopup=true' //iframe的url
            });
        }

        function ClearPage() {
            $("#Parent_ID").val(-1);
            $("#ParentName").val("");
        }
        function changeParentPage(_id, _name, _code) {
            $("#Parent_ID").val(_id);
            $("#ParentName").val(_name);
            $("#ParentCode").val(_code);
            layer.close(layer.index);
        }
    </script>
